import os
from dotenv import load_dotenv

load_dotenv()

class Settings:
    # 数据库配置
    DATABASE_URL: str = os.getenv("DATABASE_URL", "sqlite:///./fortune_telling.db")
    
    # JWT 配置
    SECRET_KEY: str = os.getenv("SECRET_KEY", "your-secret-key-here")
    ALGORITHM: str = os.getenv("ALGORITHM", "HS256")
    ACCESS_TOKEN_EXPIRE_MINUTES: int = int(os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES", "30"))
    
    # OpenAI 配置
    OPENAI_API_KEY: str = os.getenv("OPENAI_API_KEY", "")
    OPENAI_BASE_URL: str = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1")
    OPENAI_MODEL: str = os.getenv("OPENAI_MODEL", "gpt-3.5-turbo")
    OPENAI_ANALYSIS_MODEL: str = os.getenv("OPENAI_ANALYSIS_MODEL", "gpt-3.5-turbo")
    
    # 推理模型配置
    ENABLE_REASONING: bool = os.getenv("ENABLE_REASONING", "False").lower() == "true"
    REASONING_EFFORT: str = os.getenv("REASONING_EFFORT", "medium")  # low, medium, high
    USE_REASONING_MODEL: bool = os.getenv("USE_REASONING_MODEL", "False").lower() == "true"
    
    # 应用配置
    APP_NAME: str = os.getenv("APP_NAME", "AI生辰八字算命系统")
    DEBUG: bool = os.getenv("DEBUG", "True").lower() == "true"

settings = Settings()
